a = input("").split(" ")
b = input("").split(" ")

a = [int(i) for i in a]
b = [int(i) for i in b]

c = a + b
c.sort()

temp = None

for i in c:
    if temp != i:
        print(i, end="")
    temp = i
